package com.wnhz.work.yz.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.wnhz.work.yz.BaseActivity;
import com.wnhz.work.yz.R;
import com.wnhz.work.yz.base.BaseRVAdapter;
import com.wnhz.work.yz.base.BaseViewHolder;
import com.wnhz.work.yz.base.RecycleViewDivider;
import com.wnhz.work.yz.utils.DisplayUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * 查看物流
 */
public class ExamineLogisticsActivity extends BaseActivity implements View.OnClickListener{
    private TextView title;
    private static final String TAG = "ExamineLogisticsActivit";
    private RecyclerView recyclerView;
    private BaseRVAdapter<ExamineLogisticsBean> adapter;
    private List<ExamineLogisticsBean> mList = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_examine_logistics);
        initView();
    }

    private void initView() {
        title = (TextView) findViewById(R.id.view_main_middle_title);
        title.setText("查看物流");
        findViewById(R.id.btn_main_left).setOnClickListener(this);

        recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        RecycleViewDivider recycleViewDivider = new RecycleViewDivider(this, LinearLayout.HORIZONTAL
                , getResources().getDimensionPixelSize(R.dimen.line_h), getResources().getColor(R.color.line_color));
        recycleViewDivider.setMarginLeft(DisplayUtil.dp2px(this,24));
        recyclerView.addItemDecoration(recycleViewDivider);
        adapter = new BaseRVAdapter<ExamineLogisticsBean>(this, mList) {
            @Override
            public int getLayoutId(int viewType) {
                return R.layout.item_examine_logistics;
            }

            @Override
            public void onBind(BaseViewHolder holder, int position) {

            }

            @Override
            public int getItemCount() {
                return 6;
            }
        };

        recyclerView.setAdapter(adapter);
    }

    @Override
    public void onClick(View v) {
        Intent intent;
        int index;
        switch (v.getId()) {
            case R.id.btn_main_left:
                finish();
                break;

            default:
                break;
        }
    }

    private class ExamineLogisticsBean {

    }
}
